#!/bin/bash
# Update changelog
git-changelog -c angular -o CHANGELOG.md -t angular --bump auto -p github $*
git add CHANGELOG.md

# Get the generated version number and update setup.py file with the new version number
version=$(grep -oP '(?<=## \[)[^]]*' CHANGELOG.md | head -n 1)
sed -i "s/version\s*=.*/version = $version/" setup.cfg
git add setup.cfg

# Add release message
git commit -m "chore: release $version"
git tag $version

git push
git push --tags